package main

//生成GF(2^8)的所有生成元
func GenarateUnit_8() (gunit []uint8) {
	for i := 0; i < 256; i++ {
		flag := 0
		a := i
		// fmt.Println("开始", i)
		for j := 0; j < 254; j++ {
			a = int(GFmul_8(uint8(a), uint8(i)))
			// fmt.Println(a)
			if a == i {
				flag = 1
				break
			}
		}
		if flag == 0 {
			gunit = append(gunit, uint8(i))
		}
	}
	return gunit
}
